/*
 * @Author       : Bing Chen chenbing@iocharger.com
 * @Date         : 2024-06-05 09:21:25
 * @LastEditors  : liubangyi liubangliuyi@163.com
 * @LastEditTime : 2025-03-17 15:04:50
 * @FilePath     : /openchaoji-corelib/shared/include/OpenChaoJi_def_gbt27930_b.h
 * @Description  : 本文件定义27930规定的B类系统的所有报文格式标识超时和模块状态定义等
 *
 * Copyright (c) 2025 OpenChaoJi
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the icense for the specific language governing permissions and
 * limitations under the License.
 *
 */

#ifndef __OPEN_CHAOJI_DEF_GBT27930_B_H__
#define __OPEN_CHAOJI_DEF_GBT27930_B_H__

#include "OpenChaoJi_config.h"
#include "OpenChaoJi_type.h"

#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B == CONFIG_YES)

/********************************** 所有B类系统的模块和状态统一定义状态ID  **********************************/

/* Idle 默认值0固定, 只有一个状态 */
enum OpenChaoJi_gbt27930_b_secc_stauts_idle {
    OPENCHAOJI_GBT27930_B_SECC_STATUS_IDLE_S0_IDLE = 0,

    OPENCHAOJI_GBT27930_B_SECC_STATUS_IDLE_NUM
};
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_IDLE_S0_IDLE                 OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_IDLE, OPENCHAOJI_GBT27930_B_SECC_STATUS_IDLE_S0_IDLE)

enum OpenChaoJi_gbt27930_b_evcc_stauts_idle {
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_IDLE_S0_IDLE = 0,

    OPENCHAOJI_GBT27930_B_EVCC_STATUS_IDLE_NUM
};
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_IDLE_S0_IDLE                 OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_IDLE, OPENCHAOJI_GBT27930_B_EVCC_STATUS_IDLE_S0_IDLE)

/* Trigger */
enum OpenChaoJi_gbt27930_b_secc_stauts_trigger {
    OPENCHAOJI_GBT27930_B_SECC_STATUS_TRIGGER_S0_CONNECT = 0,
    OPENCHAOJI_GBT27930_B_SECC_STATUS_TRIGGER_S1_SESSION,

    OPENCHAOJI_GBT27930_B_SECC_STATUS_TRIGGER_NUM
};
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_TRIGGER_S0_CONNECT           OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_TRIGGER, OPENCHAOJI_GBT27930_B_SECC_STATUS_TRIGGER_S0_CONNECT)
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_TRIGGER_S1_SESSION           OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_TRIGGER, OPENCHAOJI_GBT27930_B_SECC_STATUS_TRIGGER_S1_SESSION)

enum OpenChaoJi_gbt27930_b_evcc_stauts_trigger {
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_TRIGGER_S0_CONFIRM_CONNECT = 0,   // T0: 确认连接  检测点2电压由0V->10.8V(或2.34V)
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_TRIGGER_S1_CONFIRM_SECC_TYPE,     // T1: 确认SECC类型 检测点3电压为U2的一半
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_TRIGGER_S2_FULL_CONNECT,          // T2: 允许完全连接 闭合S2p, 此时检测点1和2的电压均为2.34V
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_TRIGGER_S3_CONFIRM_SECC_READY,    // T3: 确认SECC准备就绪  检测点1和2的电压均为2.34V
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_TRIGGER_S4_SESSION,               // T4: 等待SECC发起会话且版本协商后并建立会话连接

#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_A == CONFIG_YES)
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_TRIGGER_SA_SYSTEM_A,              // 连接A类SECC系统
#endif

    OPENCHAOJI_GBT27930_B_EVCC_STATUS_TRIGGER_NUM
};
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_TRIGGER_S0_CONFIRM_CONNECT     OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_TRIGGER, OPENCHAOJI_GBT27930_B_EVCC_STATUS_TRIGGER_S0_CONFIRM_CONNECT)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_TRIGGER_S1_CONFIRM_SECC_TYPE   OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_TRIGGER, OPENCHAOJI_GBT27930_B_EVCC_STATUS_TRIGGER_S1_CONFIRM_SECC_TYPE)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_TRIGGER_S2_FULL_CONNECT        OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_TRIGGER, OPENCHAOJI_GBT27930_B_EVCC_STATUS_TRIGGER_S2_FULL_CONNECT)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_TRIGGER_S3_CONFIRM_SECC_READY  OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_TRIGGER, OPENCHAOJI_GBT27930_B_EVCC_STATUS_TRIGGER_S3_CONFIRM_SECC_READY)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_TRIGGER_S4_SESSION             OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_TRIGGER, OPENCHAOJI_GBT27930_B_EVCC_STATUS_TRIGGER_S4_SESSION)

#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_TRIGGER_SA_SYSMTEM_A           OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_TRIGGER, OPENCHAOJI_GBT27930_B_EVCC_STATUS_TRIGGER_SA_SYSTEM_A)

/* 功能协商 */
enum OpenChaoJi_gbt27930_b_secc_stauts_id_func_nego {
    OPENCHAOJI_GBT27930_B_SECC_STATUS_FUNC_NEGO_S0_INIT = 0,
    OPENCHAOJI_GBT27930_B_SECC_STATUS_FUNC_NEGO_S1_NEGO,
    OPENCHAOJI_GBT27930_B_SECC_STATUS_FUNC_NEGO_S2_PHASE_CONFIRM,
    OPENCHAOJI_GBT27930_B_SECC_STATUS_FUNC_NEGO_S3_SUCCEED,
    OPENCHAOJI_GBT27930_B_SECC_STATUS_FUNC_NEGO_S4_FAIL,

    OPENCHAOJI_GBT27930_B_SECC_STATUS_FUNC_NEGO_NUM
};
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_FUNC_NEGO_S0_INIT            OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_FUNC_NEGO, OPENCHAOJI_GBT27930_B_SECC_STATUS_FUNC_NEGO_S0_INIT)
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_FUNC_NEGO_S1_NEGO            OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_FUNC_NEGO, OPENCHAOJI_GBT27930_B_SECC_STATUS_FUNC_NEGO_S1_NEGO)
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_FUNC_NEGO_S2_PHASE_CONFIRM   OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_FUNC_NEGO, OPENCHAOJI_GBT27930_B_SECC_STATUS_FUNC_NEGO_S2_PHASE_CONFIRM)
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_FUNC_NEGO_S3_SUCCEED         OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_FUNC_NEGO, OPENCHAOJI_GBT27930_B_SECC_STATUS_FUNC_NEGO_S3_SUCCEED)
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_FUNC_NEGO_S4_FAIL            OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_FUNC_NEGO, OPENCHAOJI_GBT27930_B_SECC_STATUS_FUNC_NEGO_S4_FAIL)

enum OpenChaoJi_gbt27930_b_evcc_stauts_id_func_nego {
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_FUNC_NEGO_S1_NEGO = 0,
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_FUNC_NEGO_S2_PHASE_CONFIRM,
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_FUNC_NEGO_S3_SUCCEED,
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_FUNC_NEGO_S4_FAIL,

    OPENCHAOJI_GBT27930_B_EVCC_STATUS_FUNC_NEGO_NUM
};
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_FUNC_NEGO_S1_NEGO            OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_FUNC_NEGO, OPENCHAOJI_GBT27930_B_EVCC_STATUS_FUNC_NEGO_S1_NEGO)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_FUNC_NEGO_S2_PHASE_CONFIRM   OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_FUNC_NEGO, OPENCHAOJI_GBT27930_B_EVCC_STATUS_FUNC_NEGO_S2_PHASE_CONFIRM)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_FUNC_NEGO_S3_SUCCEED         OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_FUNC_NEGO, OPENCHAOJI_GBT27930_B_EVCC_STATUS_FUNC_NEGO_S3_SUCCEED)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_FUNC_NEGO_S4_FAIL            OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_FUNC_NEGO, OPENCHAOJI_GBT27930_B_EVCC_STATUS_FUNC_NEGO_S4_FAIL)

/* 参数配置 */
enum OpenChaoJi_gbt27930_b_secc_stauts_id_param_config {
    OPENCHAOJI_GBT27930_B_SECC_STATUS_PARAM_CONFIG_S0_INIT = 0,
    OPENCHAOJI_GBT27930_B_SECC_STATUS_PARAM_CONFIG_S1_CONFIG,
    OPENCHAOJI_GBT27930_B_SECC_STATUS_PARAM_CONFIG_S2_PHASE_CONFIRM,
    OPENCHAOJI_GBT27930_B_SECC_STATUS_PARAM_CONFIG_S3_SUCCEED,
    OPENCHAOJI_GBT27930_B_SECC_STATUS_PARAM_CONFIG_S4_FAIL,

    OPENCHAOJI_GBT27930_B_SECC_STATUS_PARAM_CONFIG_NUM
};
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_PARAM_CONFIG_S0_INIT            OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_PARAM_CONFIG, OPENCHAOJI_GBT27930_B_SECC_STATUS_PARAM_CONFIG_S0_INIT)
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_PARAM_CONFIG_S1_CONFIG          OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_PARAM_CONFIG, OPENCHAOJI_GBT27930_B_SECC_STATUS_PARAM_CONFIG_S1_CONFIG)
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_PARAM_CONFIG_S2_PHASE_CONFIRM   OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_PARAM_CONFIG, OPENCHAOJI_GBT27930_B_SECC_STATUS_PARAM_CONFIG_S2_PHASE_CONFIRM)
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_PARAM_CONFIG_S3_SUCCEED         OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_PARAM_CONFIG, OPENCHAOJI_GBT27930_B_SECC_STATUS_PARAM_CONFIG_S3_SUCCEED)
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_PARAM_CONFIG_S4_FAIL            OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_PARAM_CONFIG, OPENCHAOJI_GBT27930_B_SECC_STATUS_PARAM_CONFIG_S4_FAIL)

enum OpenChaoJi_gbt27930_b_evcc_stauts_id_param_config {
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_PARAM_CONFIG_S0_INIT = 0,
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_PARAM_CONFIG_S1_CONFIG,
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_PARAM_CONFIG_S2_PHASE_CONFIRM,
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_PARAM_CONFIG_S3_SUCCEED,
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_PARAM_CONFIG_S4_FAIL,

    OPENCHAOJI_GBT27930_B_EVCC_STATUS_PARAM_CONFIG_NUM
};
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_PARAM_CONFIG_S0_INIT            OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_PARAM_CONFIG, OPENCHAOJI_GBT27930_B_EVCC_STATUS_PARAM_CONFIG_S0_INIT)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_PARAM_CONFIG_S1_CONFIG          OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_PARAM_CONFIG, OPENCHAOJI_GBT27930_B_EVCC_STATUS_PARAM_CONFIG_S1_CONFIG)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_PARAM_CONFIG_S2_PHASE_CONFIRM   OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_PARAM_CONFIG, OPENCHAOJI_GBT27930_B_EVCC_STATUS_PARAM_CONFIG_S2_PHASE_CONFIRM)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_PARAM_CONFIG_S3_SUCCEED         OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_PARAM_CONFIG, OPENCHAOJI_GBT27930_B_EVCC_STATUS_PARAM_CONFIG_S3_SUCCEED)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_PARAM_CONFIG_S4_FAIL            OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_PARAM_CONFIG, OPENCHAOJI_GBT27930_B_EVCC_STATUS_PARAM_CONFIG_S4_FAIL)

/* 鉴权 */
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_AUTH == CONFIG_YES)
    #if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_AUTH_RFID == CONFIG_YES)
    /* 鉴权 - RFID模式(FDC=1) 桩端*/
    enum OpenChaoJi_gbt27930_b_secc_stauts_id_auth_rfid {
        OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_RFID_S0_INIT = 0,           // 初始化
        OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_RFID_S1_SCAN_CARD,          // 扫码刷卡
        OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_RFID_S2_AUTH_COMPLETE,      // 完成鉴权
        OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_RFID_S3_PHASE_CONFIRM,      // 阶段确认
        OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_RFID_S4_SUCCEED,            // 成功
        OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_RFID_S5_FAIL,               // 失败

        OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_RFID_NUM
    };
    #define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_AUTH_RFID_S0_INIT           OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_RFID, OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_RFID_S0_INIT)
    #define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_AUTH_RFID_S1_SCAN_CARD      OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_RFID, OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_RFID_S1_SCAN_CARD)
    #define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_AUTH_RFID_S2_AUTH_COMPLETE  OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_RFID, OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_RFID_S2_AUTH_COMPLETE)
    #define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_AUTH_RFID_S3_PHASE_CONFIRM  OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_RFID, OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_RFID_S3_PHASE_CONFIRM)
    #define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_AUTH_RFID_S4_SUCCEED        OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_RFID, OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_RFID_S4_SUCCEED)
    #define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_AUTH_RFID_S5_FAIL           OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_RFID, OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_RFID_S5_FAIL)

    /* 鉴权 - RFID模式(FDC=1) 车端 */
    enum OpenChaoJi_gbt27930_b_evcc_status_id_auth_rfid {
        OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_RFID_S0_INIT = 0,           // 初始化
        OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_RFID_S1_NEGOTIATING,        // 协商中
        OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_RFID_S2_WAIT_SCAN_CARD,     // 等待扫码/刷卡
        OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_RFID_S3_PHASE_CONFIRM,      // 阶段确认过程
        OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_RFID_S4_SUCCEED,            // 成功
        OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_RFID_S5_FAIL,               // 失败

        OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_RFID_NUM
    };

    #define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_AUTH_RFID_S0_INIT            OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_RFID, OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_RFID_S0_INIT)
    #define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_AUTH_RFID_S1_NEGOTIATING     OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_RFID, OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_RFID_S1_NEGOTIATING)
    #define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_AUTH_RFID_S2_WAIT_SCAN_CARD  OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_RFID, OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_RFID_S2_WAIT_SCAN_CARD)
    #define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_AUTH_RFID_S3_PHASE_CONFIRM   OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_RFID, OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_RFID_S3_PHASE_CONFIRM)
    #define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_AUTH_RFID_S4_SUCCEED         OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_RFID, OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_RFID_S4_SUCCEED)
    #define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_AUTH_RFID_S5_FAIL            OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_RFID, OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_RFID_S5_FAIL)


    #endif

    #if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_AUTH_EVIN == CONFIG_YES)
    /* 鉴权 - EVIN模式(FDC=2) 桩端*/
    enum OpenChaoJi_gbt27930_b_secc_stauts_id_auth_evin {
        OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_EVIN_S0_INIT = 0,           // 初始化
        OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_EVIN_S1_AUTH_PROCESS,       // 鉴权过程
        OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_EVIN_S2_AUTH_COMPLETE,      // 完成鉴权
        OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_EVIN_S3_PHASE_CONFIRM,      // 阶段确认
        OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_EVIN_S4_SUCCEED,            // 成功
        OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_EVIN_S5_FAIL,               // 失败

        OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_EVIN_NUM
    };
    #define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_AUTH_EVIN_S0_INIT           OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_EVIN, OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_EVIN_S0_INIT)
    #define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_AUTH_EVIN_S1_AUTH_PROCESS   OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_EVIN, OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_EVIN_S1_AUTH_PROCESS)
    #define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_AUTH_EVIN_S2_AUTH_COMPLETE  OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_EVIN, OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_EVIN_S2_AUTH_COMPLETE)
    #define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_AUTH_EVIN_S3_PHASE_CONFIRM  OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_EVIN, OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_EVIN_S3_PHASE_CONFIRM)
    #define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_AUTH_EVIN_S4_SUCCEED        OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_EVIN, OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_EVIN_S4_SUCCEED)
    #define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_AUTH_EVIN_S5_FAIL           OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_EVIN, OPENCHAOJI_GBT27930_B_SECC_STATUS_AUTH_EVIN_S5_FAIL)

    /* 鉴权 - EVIN模式(FDC=2) 车端 */
    enum OpenChaoJi_gbt27930_b_evcc_status_id_auth_evin {
        OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_EVIN_S0_INIT = 0,            // 初始化
        OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_EVIN_S1_NEGOTIATING,         // 协商中
        OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_EVIN_S2_WAIT_RESULT,         // 等待协商结果
        OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_EVIN_S3_PHASE_CONFIRM,       // 阶段确认过程
        OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_EVIN_S4_SUCCEED,             // 成功
        OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_EVIN_S5_FAIL,                // 失败

        OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_EVIN_NUM
    };

    #define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_AUTH_EVIN_S0_INIT           OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_EVIN, OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_EVIN_S0_INIT)
    #define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_AUTH_EVIN_S1_NEGOTIATING    OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_EVIN, OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_EVIN_S1_NEGOTIATING)
    #define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_AUTH_EVIN_S2_WAIT_RESULT    OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_EVIN, OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_EVIN_S2_WAIT_RESULT)
    #define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_AUTH_EVIN_S3_PHASE_CONFIRM  OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_EVIN, OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_EVIN_S3_PHASE_CONFIRM)
    #define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_AUTH_EVIN_S4_SUCCEED        OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_EVIN, OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_EVIN_S4_SUCCEED)
    #define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_AUTH_EVIN_S5_FAIL           OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_AUTH_EVIN, OPENCHAOJI_GBT27930_B_EVCC_STATUS_AUTH_EVIN_S5_FAIL)
    #endif
#endif

/* 自检 */
enum OpenChaoJi_gbt27930_b_secc_stauts_id_selfcheck {
    OPENCHAOJI_GBT27930_B_SECC_STATUS_SELF_CHECK_S0_INIT = 0,
    OPENCHAOJI_GBT27930_B_SECC_STATUS_SELF_CHECK_S1_ELOCKED,
    OPENCHAOJI_GBT27930_B_SECC_STATUS_SELF_CHECK_S2_CHECKING,
    OPENCHAOJI_GBT27930_B_SECC_STATUS_SELF_CHECK_S3_PHASE_CONFIRM,
    OPENCHAOJI_GBT27930_B_SECC_STATUS_SELF_CHECK_S4_SUCCEED,
    OPENCHAOJI_GBT27930_B_SECC_STATUS_SELF_CHECK_S5_FAIL,

    OPENCHAOJI_GBT27930_B_SECC_STATUS_SELF_CHECK_NUM
};
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_SELF_CHECK_S0_INIT           	OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_SELFCHECK, OPENCHAOJI_GBT27930_B_SECC_STATUS_SELF_CHECK_S0_INIT)
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_SELF_CHECK_S1_ELOCKED   	 	OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_SELFCHECK, OPENCHAOJI_GBT27930_B_SECC_STATUS_SELF_CHECK_S1_ELOCKED)
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_SELF_CHECK_S2_CHECKING			OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_SELFCHECK, OPENCHAOJI_GBT27930_B_SECC_STATUS_SELF_CHECK_S2_CHECKING)
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_SELF_CHECK_S3_PHASE_CONFIRM	OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_SELFCHECK, OPENCHAOJI_GBT27930_B_SECC_STATUS_SELF_CHECK_S3_PHASE_CONFIRM)
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_SELF_CHECK_S4_SUCCEED        	OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_SELFCHECK, OPENCHAOJI_GBT27930_B_SECC_STATUS_SELF_CHECK_S4_SUCCEED)
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_SELF_CHECK_S5_FAIL        	 	OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_SELFCHECK, OPENCHAOJI_GBT27930_B_SECC_STATUS_SELF_CHECK_S5_FAIL)

enum OpenChaoJi_gbt27930_b_evcc_stauts_id_selfcheck {
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_SELF_CHECK_S0_INIT = 0,
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_SELF_CHECK_S1_ELOCKED,
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_SELF_CHECK_S2_CHECKING,
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_SELF_CHECK_S3_PHASE_CONFIRM,
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_SELF_CHECK_S4_SUCCEED,
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_SELF_CHECK_S5_FAIL,

    OPENCHAOJI_GBT27930_B_EVCC_STATUS_SELF_CHECK_NUM
};
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_SELF_CHECK_S0_INIT           	OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_SELFCHECK, OPENCHAOJI_GBT27930_B_EVCC_STATUS_SELF_CHECK_S0_INIT)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_SELF_CHECK_S1_ELOCKED   	 	OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_SELFCHECK, OPENCHAOJI_GBT27930_B_EVCC_STATUS_SELF_CHECK_S1_ELOCKED)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_SELF_CHECK_S2_CHECKING			OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_SELFCHECK, OPENCHAOJI_GBT27930_B_EVCC_STATUS_SELF_CHECK_S2_CHECKING)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_SELF_CHECK_S3_PHASE_CONFIRM	OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_SELFCHECK, OPENCHAOJI_GBT27930_B_EVCC_STATUS_SELF_CHECK_S3_PHASE_CONFIRM)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_SELF_CHECK_S4_SUCCEED        	OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_SELFCHECK, OPENCHAOJI_GBT27930_B_EVCC_STATUS_SELF_CHECK_S4_SUCCEED)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_SELF_CHECK_S5_FAIL        	 	OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_SELFCHECK, OPENCHAOJI_GBT27930_B_EVCC_STATUS_SELF_CHECK_S5_FAIL)


/* 预充及能量传输(FDC=1) 桩端*/
enum OpenChaoJi_gbt27930_b_secc_stauts_id_charging {
    OPENCHAOJI_GBT27930_B_SECC_STATUS_CHARGING_S0_INIT = 0,           // 初始化
    OPENCHAOJI_GBT27930_B_SECC_STATUS_CHARGING_S1_WAIT_VEHICLE_READY, // 等待车辆就绪
    OPENCHAOJI_GBT27930_B_SECC_STATUS_CHARGING_S2_PRECHARGE,          // 充电机预充
    OPENCHAOJI_GBT27930_B_SECC_STATUS_CHARGING_S3_CHARGER_READY,      // 充电机就绪
    OPENCHAOJI_GBT27930_B_SECC_STATUS_CHARGING_S4_ENERGY_TRANSFER,    // 能量传输
    OPENCHAOJI_GBT27930_B_SECC_STATUS_CHARGING_S5_PHASE_CONFIRM,      // 阶段确认过程
    OPENCHAOJI_GBT27930_B_SECC_STATUS_CHARGING_S6_FINISH,             // 预充及能量传输结束
    OPENCHAOJI_GBT27930_B_SECC_STATUS_CHARGING_S7_EXIT_CHARGING,      // 退出充电

    OPENCHAOJI_GBT27930_B_SECC_STATUS_CHARGING_NUM
};

#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_CHARGING_S0_INIT               OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_CHARGING, OPENCHAOJI_GBT27930_B_SECC_STATUS_CHARGING_S0_INIT)
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_CHARGING_S1_WAIT_VEHICLE_READY OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_CHARGING, OPENCHAOJI_GBT27930_B_SECC_STATUS_CHARGING_S1_WAIT_VEHICLE_READY)
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_CHARGING_S2_PRECHARGE          OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_CHARGING, OPENCHAOJI_GBT27930_B_SECC_STATUS_CHARGING_S2_PRECHARGE)
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_CHARGING_S3_CHARGER_READY      OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_CHARGING, OPENCHAOJI_GBT27930_B_SECC_STATUS_CHARGING_S3_CHARGER_READY)
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_CHARGING_S4_ENERGY_TRANSFER    OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_CHARGING, OPENCHAOJI_GBT27930_B_SECC_STATUS_CHARGING_S4_ENERGY_TRANSFER)
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_CHARGING_S5_PHASE_CONFIRM      OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_CHARGING, OPENCHAOJI_GBT27930_B_SECC_STATUS_CHARGING_S5_PHASE_CONFIRM)
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_CHARGING_S6_FINISH             OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_CHARGING, OPENCHAOJI_GBT27930_B_SECC_STATUS_CHARGING_S6_FINISH)
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_CHARGING_S7_EXIT_CHARGING      OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_CHARGING, OPENCHAOJI_GBT27930_B_SECC_STATUS_CHARGING_S7_EXIT_CHARGING)

/* 预充及能量传输(FDC=1) 车端*/
enum OpenChaoJi_gbt27930_b_evcc_status_id_charging {
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_SUPPLY_S0_INIT = 0,            // 初始化
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_SUPPLY_S1_CHARGER_STATUS_CONFIRM, // 充电机状态确认
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_SUPPLY_S2_VEHICLE_NOT_READY,    // 车辆未就绪
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_SUPPLY_S3_VEHICLE_READY,        // 车辆就绪
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_SUPPLY_S4_ENERGY_TRANSFER,      // 能量传输
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_SUPPLY_S5_PHASE_CONFIRM,        // 阶段确认过程
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_SUPPLY_S6_FINISH,               // 预充及能量传输结束
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_SUPPLY_S7_EXIT_CHARGING,        // 退出充电

    OPENCHAOJI_GBT27930_B_EVCC_STATUS_SUPPLY_NUM
};

#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_CHARGING_S0_INIT               OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_CHARGING, OPENCHAOJI_GBT27930_B_EVCC_STATUS_SUPPLY_S0_INIT)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_CHARGING_S1_CHARGER_STATUS_CONFIRM OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_CHARGING, OPENCHAOJI_GBT27930_B_EVCC_STATUS_SUPPLY_S1_CHARGER_STATUS_CONFIRM)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_CHARGING_S2_VEHICLE_NOT_READY  OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_CHARGING, OPENCHAOJI_GBT27930_B_EVCC_STATUS_SUPPLY_S2_VEHICLE_NOT_READY)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_CHARGING_S3_VEHICLE_READY      OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_CHARGING, OPENCHAOJI_GBT27930_B_EVCC_STATUS_SUPPLY_S3_VEHICLE_READY)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_CHARGING_S4_ENERGY_TRANSFER    OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_CHARGING, OPENCHAOJI_GBT27930_B_EVCC_STATUS_SUPPLY_S4_ENERGY_TRANSFER)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_CHARGING_S5_PHASE_CONFIRM      OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_CHARGING, OPENCHAOJI_GBT27930_B_EVCC_STATUS_SUPPLY_S5_PHASE_CONFIRM)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_CHARGING_S6_FINISH             OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_CHARGING, OPENCHAOJI_GBT27930_B_EVCC_STATUS_SUPPLY_S6_FINISH)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_CHARGING_S7_EXIT_CHARGING      OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_CHARGING, OPENCHAOJI_GBT27930_B_EVCC_STATUS_SUPPLY_S7_EXIT_CHARGING)



/* 服务统计停止中功能模块 */
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_STATISTICS_STOPING == CONFIG_YES)
    #if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_STATISTICS_STOPING_CHARGE == CONFIG_YES)
/* 服务统计 - 停止中(FDC=1) SECC*/
    enum OpenChaoJi_gbt27930_b_secc_stauts_stoping {
        OPENCHAOJI_GBT27930_B_SECC_STATUS_STOPING_S0_NORMAL = 0,
        OPENCHAOJI_GBT27930_B_SECC_STATUS_STOPING_S1_FAULT,
        OPENCHAOJI_GBT27930_B_SECC_STATUS_STOPING_S2_EMRGE,
        OPENCHAOJI_GBT27930_B_SECC_STATUS_STOPING_S3_PHASE_CONFIRM,

        OPENCHAOJI_GBT27930_B_SECC_STATUS_STOPING_END_NUM
    };
    #define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_STOPING_S0_NORMAL            OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_STATISTICS_STOPING, OPENCHAOJI_GBT27930_B_SECC_STATUS_STOPING_S0_NORMAL)
    #define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_STOPING_S1_FAULT             OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_STATISTICS_STOPING, OPENCHAOJI_GBT27930_B_SECC_STATUS_STOPING_S1_FAULT)
    #define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_STOPING_S2_EMRGE             OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_STATISTICS_STOPING, OPENCHAOJI_GBT27930_B_SECC_STATUS_STOPING_S2_EMRGE)
    #define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_STOPING_S3_PHASE_CONFIRM     OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_STATISTICS_STOPING, OPENCHAOJI_GBT27930_B_SECC_STATUS_STOPING_S3_PHASE_CONFIRM)

/* 服务统计 - 停止中(FDC=1) EVCC*/
    enum OpenChaoJi_gbt27930_b_evcc_stauts_stoping {
        OPENCHAOJI_GBT27930_B_EVCC_STATUS_STOPING_S0_NORMAL = 0,
        OPENCHAOJI_GBT27930_B_EVCC_STATUS_STOPING_S1_FAULT,
        OPENCHAOJI_GBT27930_B_EVCC_STATUS_STOPING_S2_EMRGE,
        OPENCHAOJI_GBT27930_B_EVCC_STATUS_STOPING_S3_PHASE_CONFIRM,

        OPENCHAOJI_GBT27930_B_EVCC_STATUS_STOPING_END_NUM
    };
    #define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_STOPING_S0_NORMAL            OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_STATISTICS_STOPING, OPENCHAOJI_GBT27930_B_EVCC_STATUS_STOPING_S0_NORMAL)
    #define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_STOPING_S1_FAULT             OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_STATISTICS_STOPING, OPENCHAOJI_GBT27930_B_EVCC_STATUS_STOPING_S1_FAULT)
    #define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_STOPING_S2_EMRGE             OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_STATISTICS_STOPING, OPENCHAOJI_GBT27930_B_EVCC_STATUS_STOPING_S2_EMRGE)
    #define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_STOPING_S3_PHASE_CONFIRM     OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_STATISTICS_STOPING, OPENCHAOJI_GBT27930_B_EVCC_STATUS_STOPING_S3_PHASE_CONFIRM)

    #endif

#endif

/* 服务统计功能模块 */
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_STATISTICS == CONFIG_YES)
    #if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_STATISTICS == CONFIG_YES)
/* 服务统计 - 充电服务统计(FDC=1) SECC*/
    enum OpenChaoJi_gbt27930_b_secc_status_id_statistics {
        OPENCHAOJI_GBT27930_B_SECC_STATUS_STATISTICS_S0_INIT = 0,            // 初始化
        OPENCHAOJI_GBT27930_B_SECC_STATUS_STATISTICS_S1_WAIT_EV_PACKET,      // 等待车辆统计报文
        OPENCHAOJI_GBT27930_B_SECC_STATUS_STATISTICS_S2_RETURN,              // 退出

        OPENCHAOJI_GBT27930_B_SECC_STATUS_STATISTICS_NUM
    };
    #define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_STATISTICS_S0_INIT              OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_STATISTICS, OPENCHAOJI_GBT27930_B_SECC_STATUS_STATISTICS_S0_INIT)
    #define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_STATISTICS_S1_WAIT_EV_PACKET    OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_STATISTICS, OPENCHAOJI_GBT27930_B_SECC_STATUS_STATISTICS_S1_WAIT_EV_PACKET)
    #define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_STATISTICS_S2_RETURN            OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_STATISTICS, OPENCHAOJI_GBT27930_B_SECC_STATUS_STATISTICS_S2_RETURN)

/* 服务统计 - 充电服务统计(FDC=1) EVCC*/
    enum OpenChaoJi_gbt27930_b_evcc_status_id_statistics{
        OPENCHAOJI_GBT27930_B_EVCC_STATUS_STATISTICS_S0_INIT = 0,            // 初始化
        OPENCHAOJI_GBT27930_B_EVCC_STATUS_STATISTICS_S1_WAIT_EV_PACKET,      // 等待充电机统计报文
        OPENCHAOJI_GBT27930_B_EVCC_STATUS_STATISTICS_S2_RETURN,              // 退出

        OPENCHAOJI_GBT27930_B_EVCC_STATUS_STATISTICS_NUM
    };
    #define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_STATISTICS_S0_INIT              OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_STATISTICS, OPENCHAOJI_GBT27930_B_EVCC_STATUS_STATISTICS_S0_INIT)
    #define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_STATISTICS_S1_WAIT_EV_PACKET    OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_STATISTICS, OPENCHAOJI_GBT27930_B_EVCC_STATUS_STATISTICS_S1_WAIT_EV_PACKET)
    #define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_STATISTICS_S2_RETURN            OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_STATISTICS, OPENCHAOJI_GBT27930_B_EVCC_STATUS_STATISTICS_S2_RETURN)

    #endif

#endif

/* End */
enum OpenChaoJi_gbt27930_b_secc_stauts_end {
    OPENCHAOJI_GBT27930_B_SECC_STATUS_END_S0_FINISHING = 0,
    OPENCHAOJI_GBT27930_B_SECC_STATUS_END_S1_FINISHED,

    OPENCHAOJI_GBT27930_B_SECC_STATUS_END_NUM
};
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_END_S0_FINISHING             OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_END, OPENCHAOJI_GBT27930_B_SECC_STATUS_END_S0_FINISHING)
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_END_S1_FINISHED              OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_END, OPENCHAOJI_GBT27930_B_SECC_STATUS_END_S1_FINISHED)

enum OpenChaoJi_gbt27930_b_evcc_stauts_end {
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_END_S0_FINISHING = 0,
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_END_S1_FINISHED,

    OPENCHAOJI_GBT27930_B_EVCC_STATUS_END_NUM
};
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_END_S0_FINISHING             OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_END, OPENCHAOJI_GBT27930_B_EVCC_STATUS_END_S0_FINISHING)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_END_S1_FINISHED              OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_END, OPENCHAOJI_GBT27930_B_EVCC_STATUS_END_S1_FINISHED)

/* Fault */
enum OpenChaoJi_gbt27930_b_secc_stauts_fault {
    OPENCHAOJI_GBT27930_B_SECC_STATUS_FAULT_S0_WAIT = 0,
    OPENCHAOJI_GBT27930_B_SECC_STATUS_FAULT_S1_RETURN,

    OPENCHAOJI_GBT27930_B_SECC_STATUS_FAULT_NUM
};
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_FAULT_S0_WAIT				 OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_FAULT, OPENCHAOJI_GBT27930_B_SECC_STATUS_FAULT_S0_WAIT)
#define OPENCHAOJI_GBT27930_B_SECC_STATUS_ID_FAULT_S1_RETURN              OPENCHAOJI_SECC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_FAULT, OPENCHAOJI_GBT27930_B_SECC_STATUS_FAULT_S1_RETURN)

enum OpenChaoJi_gbt27930_b_evcc_stauts_fault {
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_FAULT_S0_WAIT = 0,
    OPENCHAOJI_GBT27930_B_EVCC_STATUS_FAULT_S1_RETURN,

    OPENCHAOJI_GBT27930_B_EVCC_STATUS_FAULT_NUM
};
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_FAULT_S0_WAIT				 OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_FAULT, OPENCHAOJI_GBT27930_B_EVCC_STATUS_FAULT_S0_WAIT)
#define OPENCHAOJI_GBT27930_B_EVCC_STATUS_ID_FAULT_S1_RETURN              OPENCHAOJI_EVCC_MODULE_STATUS_ID(OPENCHAOJI_GBT27930_B_MODULE_FAULT, OPENCHAOJI_GBT27930_B_EVCC_STATUS_FAULT_S1_RETURN)


/********************************** 所有B类系统报文的统一Tag定义  **********************************/
//#define OPENCHAOJI_GBT27930_B_PID_TAG(PGI,ACK)   (((((int)ACK) & 0x01) << 8) | (((int)(PGI)) & 0xFF))
#define OPENCHAOJI_GBT27930_B_PID_TAG(PGI,ACK)  ( ((((uint32_t)(PGI)) & 0xFF) << 0) \
                                                | ((((uint32_t)(ACK)) & 0x01) << 27) \
                                                | ((((uint32_t)(OPENCHAOJI_GBT27930_SYSTEM_B_MSG)) & 0x03)<<28)\
                                                )

#define OPENCHAOJI_GBT27930_B_PID_FROM_TAG(TAG)  ((((uint32_t)(TAG))>>0) & 0xFF)

/*  对TAG信息中的ACK元素的解析定义 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_OF_ACK(TAG)      ((((uint32_t)(TAG))>>27) % 0x02)

#define OPENCHAOJI_GBT27930_B_PID_TAG_FUNC_NEGO_SECC         OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_FUNC_NEGO_SECC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_FUNC_NEGO_SECC     5000
struct OpenChaoJi_gbt27930_b_msg_func_support_secc {
    uint8_t pid;                            // enum SystemB_PIDType 参数组标识
    uint8_t fdc_support_auth[8];            // enum SystemB_FDCSupportType 充电机对鉴权功能模块FDC的支持情况
    uint8_t fdc_support_reserve[8];         // enum SystemB_FDCSupportType 充电机对预约功能模块FDC的支持情况
    uint8_t fdc_support_selfcheck[8];       // enum SystemB_FDCSupportType 充电机对系统自检功能模块FDC的支持情况
    uint8_t fdc_support_supply[8];          // enum SystemB_FDCSupportType 充电机对供电模式功能模块FDC的支持情况
    uint8_t fdc_support_energy[8];          // enum SystemB_FDCSupportType 充电机对预充及能量传输功能模块FDC的支持情况
    uint8_t fdc_support_statistics[8];      // enum SystemB_FDCSupportType 充电机对服务统计功能模块FDC的支持情况
    uint8_t fdc_support_service_idle[8];    // enum SystemB_FDCSupportType 充电机对服务空闲功能模块FDC的支持情况
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_FUNC_SUPPORT_SECC  57

#define OPENCHAOJI_GBT27930_B_PID_TAG_FUNC_NEGO_EVCC         OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_FUNC_NEGO_EVCC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_FUNC_NEGO_EVCC     5000
struct OpenChaoJi_gbt27930_b_msg_func_support_evcc {
    uint8_t pid;                            // enum SystemB_PIDType 参数组标识
    uint8_t fdc_auth;                       // enum SystemB_FDCType 车辆支持的鉴权功能模块FDC编码
    uint8_t fdc_reserve;                    // enum SystemB_FDCType 车辆支持的预约功能模块FDC编码
    uint8_t fdc_selfcheck;                  // enum SystemB_FDCType 车辆支持的系统自检功能模块FDC编码
    uint8_t fdc_supply;                     // enum SystemB_FDCType 车辆支持的供电模式功能模块FDC编码
    uint8_t fdc_energy;                     // enum SystemB_FDCType 车辆支持的预充及能量传输功能模块FDC编码
    uint8_t fdc_statistics;                 // enum SystemB_FDCType 车辆支持的服务统计功能模块FDC编码
    uint8_t fdc_service_idle;               // enum SystemB_FDCType 车辆支持的服务空闲功能模块FDC编码
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_FUNC_SUPPORT_EVCC  8

/********************************** 参数配置 **********************************/

/**
 * 参数配置-充电机充电参数(FDC=1) 0x21
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_FUNC_PARAM_CONFIG_SECC      OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_PARAM_CONFIG_SECC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_FUNC_PARAM_CONFIG_SECC  5000
struct OpenChaoJi_gbt27930_b_msg_param_config_secc {
    uint8_t pid;                            // enum SystemB_PIDType 参数组标识
    uint16_t parameter_max_charging_volt;   // SystemB_VoltageType1 充电机最高充电电压
    uint16_t parameter_min_charging_volt;   // SystemB_VoltageType1 充电机最低充电电压
    uint16_t parameter_max_charging_curr;   // SystemB_CurrentType  充电机最大充电电流
    uint16_t parameter_min_charging_curr;   // SystemB_CurrentType  充电机最小充电电流
    uint16_t parameter_max_discharge_volt;  // SystemB_VoltageType1 充电机最高放电电压
    uint16_t parameter_min_discharge_volt;  // SystemB_VoltageType1 充电机最低放电电压
    uint16_t parameter_max_discharge_curr;  // SystemB_CurrentType  充电机最高放电电流
    uint16_t parameter_min_discharge_curr;  // SystemB_CurrentType  充电机最低放电电流
    uint16_t parameter_raise_rate_curr;     // SystemB_ChargingRateType 充电机电流上调最小速率
    uint16_t parameter_reduce_rate_curr;    // SystemB_ChargingRateType 充电机电流下调最小速率
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_FUNC_PARAM_CONFIG_SECC  21

/**
 * 参数配置-车辆充电参数(FDC=1) 0x22
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_FUNC_PARAM_CONFIG_EVCC      OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_PARAM_CONFIG_EVCC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_FUNC_PARAM_CONFIG_EVCC  5000
struct OpenChaoJi_gbt27930_b_msg_param_config_evcc {
    uint8_t  pid;                               // enum SystemB_PIDType 参数组标识
    uint16_t parameter_max_charging_curr;       // SystemB_CurrentType  车辆最高允许充电电流
    uint16_t parameter_max_charging_volt;       // SystemB_VoltageType1 车辆最高允许充电总电压
    uint16_t parameter_max_charging_energy;     // SystemB_CapacityType 车辆最高允许输入总能量
    uint16_t parameter_soc;                     // SystemB_SOCType      车辆当前荷电状态
    uint16_t parameter_max_battery_volt;        // SystemB_VoltageType2 车辆蓄电池电芯组最高允许电压
    uint8_t  parameter_max_battery_temperature; // SystemB_TemperatureType1 车辆蓄电池电芯组最高允许温度
    uint16_t parameter_max_discharge_energy;    // SystemB_CapacityType 车辆最高允许放电总能量
    uint16_t parameter_min_discharge_volt;      // SystemB_VoltageType1 车辆最低放电电压
    uint16_t parameter_max_discharge_curr;      // SystemB_CurrentType  车辆最大放电电流
    uint16_t parameter_min_discharge_curr;      // SystemB_CurrentType  车辆最小放电电流
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_FUNC_PARAM_CONFIG_EVCC  20

/********************************** 鉴权功能 **********************************/
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_AUTH == CONFIG_YES)
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_AUTH_RFID == CONFIG_YES)

/**
 * 鉴权-充电机鉴权参数(FDC=1 扫码/刷卡鉴权) 0x31
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_AUTH_RFID_PARAM_SECC         OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_AUTH_RFID_PARAM_SECC, 0)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_AUTH_RFID_PARAM_SECC     250
// 表 E.3 充电机鉴权参数报文参数组
struct OpenChaoJi_gbt27930_b_msg_auth_rfid_param_secc {
    uint8_t pid;                          // enum SystemB_PIDType
    uint8_t c_authen_status;              // enum SystemB_CAuthenStatusType
    uint16_t m_time;                      // enum SystemB_MTimeType
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_AUTH_RFID_PARAM_SECC  4

/**
 * 鉴权-车辆鉴权结果(FDC=1 扫码/刷卡鉴权) 0x33
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_AUTH_RFID_RESULT_SECC        OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_AUTH_RFID_RESULT_SECC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_AUTH_RFID_RESULT_SECC    1000
//Tc超时
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_AUTH_RFID_TC_SECC        20000
// 表 E.5 鉴权结果报文参数组
struct OpenChaoJi_gbt27930_b_msg_auth_rfid_result_secc {
    uint8_t pid;                          // enum SystemB_PIDType
    uint8_t authen_result;                // enum SystemB_AuthenResultType
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_AUTH_RFID_RESULT_SECC  2

#endif // OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_AUTH_RFID

#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_AUTH_EVIN == CONFIG_YES)
/**
 * 鉴权-鉴权等待(FDC=1 扫码/刷卡鉴权) 0x32
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_AUTH_RFID_WAIT_EVCC          OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_AUTH_RFID_WAIT_EVCC, 0)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_AUTH_RFID_WAIT_EVCC      250
//Tv超时
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_AUTH_RFID_TV_EVCC        20000
// 表 E.4 车辆鉴权等待报文参数组
struct OpenChaoJi_gbt27930_b_msg_auth_rfid_wait_evcc {
    uint8_t pid;                          // enum SystemB_PIDType
    uint8_t v_authen_status;              // enum SystemB_VAuthenStatusType
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_AUTH_RFID_WAIT_EVCC  2

/**
 * 鉴权-鉴权请求(FDC=2 EVIN鉴权) 0x34
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_AUTH_EVIN_REQ_SECC          OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_AUTH_EVIN_REQ_SECC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_AUTH_EVIN_REQ_SECC      1000
// 表E.10 鉴权请求报文参数组
struct OpenChaoJi_gbt27930_b_msg_auth_evin_req_secc {
    uint8_t pid;  // enum SystemB_PIDType
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_AUTH_EVIN_REQ_SECC  1

/**
 * 鉴权-车辆鉴权参数(FDC=2 EVIN鉴权) 0x35
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_AUTH_PARAM_EVCC            OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_AUTH_EVIN_PARAM_EVCC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_AUTH_PARAM_EVCC        1000
//Tv超时
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_AUTH_EVIN_TV_EVCC        5000
// 表E.11 车辆鉴权参数报文参数组
struct OpenChaoJi_gbt27930_b_msg_auth_evin_param_evcc {
    uint8_t pid;                   // enum SystemB_PIDType
    uint8_t evin[17];              // BYTE[17]
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_AUTH_EVIN_PARAM_EVCC  18

/**
 * 鉴权-鉴权结果(FDC=2 EVIN鉴权) 0x36
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_AUTH_EVIN_RESULT_SECC       OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_AUTH_EVIN_RESULT_SECC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_AUTH_EVIN_RESULT_SECC   1000
//Tc超时
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_AUTH_EVIN_TC_SECC        5000
// 表E.12 鉴权结果报文参数组
struct OpenChaoJi_gbt27930_b_msg_auth_evin_result_secc {
    uint8_t pid;                // enum SystemB_PIDType
    uint8_t authen_result;     // enum SystemB_AuthenResultType
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_AUTH_EVIN_RESULT_SECC  2

#endif // OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_AUTH_EVIN

#endif // OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_AUTH

/********************************** 预约功能 **********************************/
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_RESERVE == CONFIG_YES)

#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_RESERVE_EVCC == CONFIG_YES)
/**
 * 预约-充电机预约充电信息(FDC=1) 0x41
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_FUNC_RESERVE_INFO_SECC        OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_RESERVE_INFO_SECC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_FUNC_RESERVE_INFO_SECC    10000
struct OpenChaoJi_gbt27930_b_msg_reserve_info_secc {
    uint8_t pid;                                // 参数组标识
    uint16_t max_power;             // 当前连接点最大输出功率
    uint8_t  coded_time;            // 时刻编码
    uint8_t  power_rate[192];       // 输出功率百分比
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_FUNC_RESERVE_INFO_SECC  196

/**
 * 预约-充电机预约充电确认(FDC=1) 0x42
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_FUNC_RESERVE_CONFIRM_SECC      OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_RESERVE_CONFIRM_SECC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_FUNC_RESERVE_CONFIRM_SECC  1000
struct OpenChaoJi_gbt27930_b_msg_reserve_confirm_secc {
    uint8_t pid;                    // 参数组标识
    uint8_t reservation_confirm;    // 充电机预约充电确认 ScheACKType
    uint8_t charging_now_flag;      // 充电机支持立即充电标识位 SupportChargerType
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_FUNC_RESERVE_CONFIRM_SECC  3

/**
 * 预约-车辆预约充电信息(FDC=1) 0x43
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_FUNC_RESERVE_INFO_EVCC         OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_RESERVE_INFO_EVCC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_FUNC_RESERVE_INFO_EVCC     1000
struct OpenChaoJi_gbt27930_b_msg_reserve_info_evcc {
    uint8_t pid;                    // 参数组标识
    uint16_t start_time;            // 车辆期望开始充电时间
    uint16_t set_out_time;          // 车辆期望出发时间
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_FUNC_RESERVE_INFO_EVCC  5

/**
 * 预约-车辆预约充电协商(FDC=1) 0x44
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_FUNC_RESERVE_NEGO_EVCC         OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_RESERVE_NEGO_EVCC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_FUNC_RESERVE_NEGO_EVCC     1000
struct OpenChaoJi_gbt27930_b_msg_reserve_nego_evcc {
    uint8_t pid;                    // 参数组标识
    uint8_t consult_result;         // 车辆预约充电协商结果 ScheNegoType
    uint8_t charging_now_flag;      // 车辆立即充电标识位 SupportChargerType
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_FUNC_RESERVE_NEGO_EVCC  3

#endif // OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_RESERVE_EVCC
#endif // OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_RESERVE

/********************************** 系统自检功能 **********************************/
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_SELFCHECK == CONFIG_YES)

    #if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_SELFCHECK_GENERAL == CONFIG_YES)

/**
 * 系统自检-充电机自检阶段(FDC=1)超时
 */
#define OPENCHAOJI_GBT27930_B_TIMEOUT_SELFCHECK_PHASE_SECC		20000

/**
 * 系统自检-车辆自检阶段(FDC=1)超时
 */
#define OPENCHAOJI_GBT27930_B_TIMEOUT_SELFCHECK_PHASE_EVCC		20000


/**
 * 系统自检-充电机自检状态(FDC=1) 0x51
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_FUNC_SELFCHECK_STATUS_SECC    OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_SELFCHECK_STATUS_SECC, 0)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_FUNC_SELFCHECK_STATUS_SECC  0
#define OPENCHAOJI_GBT27930_B_PID_TIMELOOP_FUNC_SELFCHECK_STATUS_SECC 250
struct OpenChaoJi_gbt27930_b_msg_selfcheck_status_secc {
    uint8_t pid;                                // 参数组标识
    uint8_t check_adhesion_status;              // 粘连检测 CheckType
    uint8_t check_short_circuit_status;         // 短路检测 CheckType
    uint8_t check_insulation_status;            // 绝缘检测 CheckType
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_FUNC_SELFCHECK_STATUS_SECC  4

/**
 * 系统自检-充电机自检结果(FDC=1) 0x52
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_FUNC_SELFCHECK_RESULT_SECC    OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_SELFCHECK_RESULT_SECC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_FUNC_SELFCHECK_RESULT_SECC  20000
struct OpenChaoJi_gbt27930_b_msg_selfcheck_result_secc {
    uint8_t pid;                                // 参数组标识
    uint8_t check_adhesion_result;              // 粘连检测结果 CheckResultType
    uint8_t check_short_circuit_result;         // 短路检测结果 CheckResultType
    uint8_t check_insulation_result;            // 绝缘检测结果 CheckResultType
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_FUNC_SELFCHECK_RESULT_SECC  4

#endif  // OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_SELFCHECK_GENERAL
#endif  // OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_SELFCHECK

/********************************** 供电模式功能 **********************************/
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_SUPPLY == CONFIG_YES)

    #if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_SUPPLY_BASIC == CONFIG_YES)

/**
 * 供电模式-充电机供电状态(FDC=1) 0x61
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_FUNC_SUPPLY_STATUS_SECC       OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_SUPPLY_STATUS_SECC, 0)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_FUNC_SUPPLY_STATUS_SECC   0
#define OPENCHAOJI_GBT27930_B_PID_TIMELOOP_FUNC_SUPPLY_STATUS_SECC  250
struct OpenChaoJi_gbt27930_b_msg_supply_status_secc {
    uint8_t pid;                                // 参数组标识
    uint8_t power_supply_status_ready;          // 充电机供电就绪状态
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_FUNC_SUPPLY_STATUS_SECC  2

/**
 * 供电模式-车辆供电状态(FDC=1) 0x62
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_FUNC_SUPPLY_STATUS_EVCC       OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_SUPPLY_STATUS_EVCC, 0)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_FUNC_SUPPLY_STATUS_EVCC   0
struct OpenChaoJi_gbt27930_b_msg_supply_status_evcc {
    uint8_t pid;                                // 参数组标识
    uint8_t power_supply_status_ready;          // 车辆供电就绪状态
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_FUNC_SUPPLY_STATUS_EVCC  2

/**
 * 供电模式-车辆供电需求(FDC=1) 0x63
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_FUNC_SUPPLY_REQUIREMENT_EVCC   OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_SUPPLY_REQUIREMENT_EVCC, 0)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_FUNC_SUPPLY_REQUIREMENT_EVCC  5000
#define OPENCHAOJI_GBT27930_B_PID_TIMELOOP_CHANGING_FUNC_SUPPLY_REQUIREMENT_EVCC 50
#define OPENCHAOJI_GBT27930_B_PID_TIMELOOP_NOT_CHANGE_FUNC_SUPPLY_REQUIREMENT_EVCC 1000
struct OpenChaoJi_gbt27930_b_msg_supply_requirement_evcc {
    uint8_t pid;                                // 参数组标识
    uint16_t power_supply_demand_volt;          // 整车供电电压需求
    uint16_t power_supply_demand_curr;          // 整车当前最大供电电流需求
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_FUNC_SUPPLY_REQUIREMENT_EVCC  5

/**
 * 供电模式-充电机动态输出能力状态(FDC=1) 0x64
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_FUNC_SUPPLY_ABILITY_SECC       OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_SUPPLY_ABILITY_SECC, 0)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_FUNC_SUPPLY_ABILITY_SECC   0
#define OPENCHAOJI_GBT27930_B_PID_TIMELOOP_FUNC_SUPPLY_ABILITY_SECC  250
struct OpenChaoJi_gbt27930_b_msg_supply_ability_secc {
    uint8_t pid;                                // 参数组标识
    uint16_t output_power_capability_curr;      // 充电机当前最大充电电流
    uint8_t  output_power_capability_reason;    // 变化原因
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_FUNC_SUPPLY_ABILITY_SECC  4

/**
 * 供电模式-车辆供电完成(FDC=1) 0x65
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_FUNC_SUPPLY_FINISH_EVCC       OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_SUPPLY_FINISH_EVCC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_FUNC_SUPPLY_FINISH_EVCC   1000
struct OpenChaoJi_gbt27930_b_msg_supply_finish_evcc {
    uint8_t pid;                                // 参数组标识
    uint16_t power_supply_finish_end;           // 车辆结束供电需求
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_FUNC_SUPPLY_FINISH_EVCC  3

#endif
#endif

/***********************预充及能量传输(充电)***********************/

#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_CHARGING == CONFIG_YES)
/**
 * 预充及能量传输-充电机就绪状态SECC(FDC=1) 0x52
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_CHARGING_READY_SECC        OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_CHARGING_READY_SECC, 0)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_CHARGING_READY_SECC    250
// 表I.3 充电机就绪状态报文参数组
struct OpenChaoJi_gbt27930_b_msg_charging_ready_secc {
    uint8_t pid;                // enum SystemB_PIDType
    uint8_t ready_status;       // enum SystemB_ReadyType
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_CHARGING_READY_SECC  2

/**
 * 预充及能量传输-车辆就绪状态报文EVCC(FDC=1) 0x72
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_CHARGING_READY_EVCC        OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_CHARGING_READY_EVCC, 0)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_CHARGING_READY_EVCC    250
// 表I.4 车辆就绪状态报文参数组
struct OpenChaoJi_gbt27930_b_msg_charging_ready_evcc {
    uint8_t pid;                // enum SystemB_PIDType
    uint16_t voltage;           // VoltageType1, WORD
    uint8_t ready_status;       // enum SystemB_ReadyType
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_CHARGING_READY_EVCC  4

/**
 * 预充及能量传输-车辆充电需求报文EVCC(FDC=1) 0x73
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_CHARGING_REQUIREMENT_EVCC    OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_CHARGING_REQUIREMENT_EVCC, 0)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_CHARGING_REQUIREMENT_EVCC 5000
// 表I.5 车辆充电需求报文参数组
struct OpenChaoJi_gbt27930_b_msg_charging_requirement_evcc {
    uint8_t pid;                // enum SystemB_PIDType
    uint16_t voltage;           // VoltageType1, WORD
    uint16_t current;           // CurrentType, WORD
    uint8_t charge_mode;        // enum SystemB_ChargeModeType
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_CHARGING_REQUIREMENT_EVCC  6

/**
 * 预充及能量传输-车辆充电基本信息EVCC(FDC=1) 0x74
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_CHARGING_INFO_BASIC_EVCC    OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_CHARGING_INFO_BASIC_EVCC, 0)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_CHARGING_INFO_BASIC_EVCC 1000
// 表I.6 车辆充电基本信息报文参数组
struct OpenChaoJi_gbt27930_b_msg_charging_info_basic_evcc {
    uint8_t pid;                // enum SystemB_PIDType
    OpenChaoJi_gbt27930_b_SOCType soc;  // SOCType, BYTE
    uint16_t left_time;              // MTimeType, WORD
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_CHARGING_INFO_BASIC_EVCC  5

/**
 * 预充及能量传输-车辆充电电池基本信息报文EVCC(FDC=1) 0x75
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_CHARGING_INFO_BATTERY_EVCC    OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_CHARGING_INFO_BATTERY_EVCC, 0)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_CHARGING_INFO_BATTERY_EVCC 1000
// 表I.7 车辆充电电池基本信息报文参数组
struct OpenChaoJi_gbt27930_b_msg_charging_info_battery_evcc {
    uint8_t pid;                // enum SystemB_PIDType
    uint16_t voltage_max;       // VoltageType2, WORD
    uint16_t voltage_min;       // VoltageType2, WORD
    uint8_t temperature_max;    // TemperatureType1, BYTE
    uint8_t temperature_min;    // TemperatureType1, BYTE
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_CHARGING_INFO_BATTERY_EVCC  7

/**
 * 预充及能量传输-充放电机动态输出能力报文SECC(FDC=1) 0x76
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_CHARGING_ABILITY_SECC        OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_CHARGING_ABILITY_SECC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_CHARGING_ABILITY_SECC    5000

// 表I.8 充电机动态输出能力报文参数组
struct OpenChaoJi_gbt27930_b_msg_charging_ability_secc {
    uint8_t pid;                // enum SystemB_PIDType
    uint16_t current;           // CurrentType, WORD
    uint8_t reason;             // enum SystemB_ReasonType
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_CHARGING_ABILITY_SECC  4

/**
 * 预充及能量传输-充电机暂停充电报文SECC(FDC=1) 0x77
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_CHARGING_PAUSE_SECC        OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_CHARGING_PAUSE_SECC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_CHARGING_PAUSE_SECC    5000

// 表I.9 充电机暂停充电报文参数组
struct OpenChaoJi_gbt27930_b_msg_charging_pause_secc {
    uint8_t pid;                // enum SystemB_PIDType
    uint8_t pause_status;       // enum SystemB_PauseStatusType
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_CHARGING_PAUSE_SECC  2
/**
 * 预充及能量传输-车辆暂停充电EVCC(FDC=1) 0x78
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_CHARGING_PAUSE_EVCC        OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_CHARGING_PAUSE_EVCC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_CHARGING_PAUSE_EVCC    5000
// 表I.10 车辆暂停充电报文参数组
struct OpenChaoJi_gbt27930_b_msg_charging_pause_evcc {
    uint8_t pid;                // enum SystemB_PIDType
    uint8_t pause_status;       // enum SystemB_PauseStatusType
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_CHARGING_PAUSE_EVCC  2


//Tc超时
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_CHARGING_TC_SECC        30000
//Tv超时
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_CHARGING_TV_EVCC        30000
//T2超时
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_CHARGING_T2_SECC        2000
//T2超时
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_CHARGING_T2_EVCC        2000

#endif

/***********************预充及能量传输(放电)***********************/
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_DISCHARGING == CONFIG_YES)

//充电机就绪状态报文
#define OPENCHAOJI_GBT27930_B_PID_TAG_DISCHARGE_READY_SECC         OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_DISCHARGING_READY_SECC, 0)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_DISCHARGE_READY_SECC     0
#define OPENCHAOJI_GBT27930_B_PID_TIMELOOP_DISCHARGE_READY_SECC    250
struct OpenChaoJi_gbt27930_b_msg_discharging_readiness_info_secc {
    uint8_t pid;                            // 参数组标识
    uint8_t readiness_ready;                // 充电机充电准备就绪状态
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_DISCHARGE_READY_SECC  2

//车辆放电就绪状态报文
#define OPENCHAOJI_GBT27930_B_PID_TAG_DISCHARGE_READY_EVCC         OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_DISCHARGING_READY_EVCC, 0)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_DISCHARGE_READY_EVCC     0
#define OPENCHAOJI_GBT27930_B_PID_TIMELOOP_DISCHARGE_READY_EVCC    250
struct OpenChaoJi_gbt27930_b_msg_discharging_readiness_info_evcc {
    uint8_t pid;                                        // 参数组标识
    uint8_t discharge_ready_interface_volt;             // 车辆接口当前电压测量值
    uint8_t discharge_ready_status;                     // 放电准备就绪状态
    uint8_t discharge_ready_total_energy;               // 整车当前动力蓄电池总能量
    uint8_t discharge_ready_participation_times;        // 参与V2G次数
    uint8_t discharge_ready_remaining_times;            // 剩余V2G次数
    uint8_t discharge_ready_remaining_mileage;          // 剩余里程
    uint8_t discharge_ready_rated_volt;                 // 整车动力蓄电池系统额定总电压
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_DISCHARGE_READY_EVCC  8

//车辆放电需求报文
#define OPENCHAOJI_GBT27930_B_PID_TAG_DISCHARGE_DEMAND_EVCC         OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_DISCHARGING_REQUIREMENT_EVCC, 0)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_DISCHARGE_DEMAND_EVCC     0
#define OPENCHAOJI_GBT27930_B_PID_TIMELOOP_DISCHARGE_DEMAND_EVCC    5000
struct OpenChaoJi_gbt27930_b_msg_discharging_demand_info_evcc {
    uint8_t  pid;                            // 参数组标识
    uint16_t discharge_demand_volt;          // 整车放电允许电压
    uint16_t discharge_demand_curr;          // 整车放电允许电流
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_DISCHARGE_DEMAND_EVCC  5

//车辆放电状态报文
#define OPENCHAOJI_GBT27930_B_PID_TAG_DISCHARGE_STATUS_EVCC         OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_DISCHARGING_STATUS_EVCC, 0)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_DISCHARGE_STATUS_EVCC     0
#define OPENCHAOJI_GBT27930_B_PID_TIMELOOP_DISCHARGE_STATUS_EVCC    1000
struct OpenChaoJi_gbt27930_b_msg_discharging_status_info_evcc {
    uint8_t  pid;                                        // 参数组标识
    uint16_t discharge_status_measure_volt;              // 放电电压测量值
    uint16_t discharge_status_measure_curr;              // 放电电流测量值
    uint16_t discharge_status_remaining_time;            // 剩余估算时间
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_DISCHARGE_STATUS_EVCC  7

//车辆放电状态报文
#define OPENCHAOJI_GBT27930_B_PID_TAG_DISCHARGE_BASIC_EVCC         OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_DISCHARGING_INFO_BASIC_EVCC, 0)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_DISCHARGE_BASIC_EVCC     0
#define OPENCHAOJI_GBT27930_B_PID_TIMELOOP_DISCHARGE_BASIC_EVCC    1000
struct OpenChaoJi_gbt27930_b_msg_discharging_basic_info_evcc {
    uint8_t  pid;                                        // 参数组标识
    uint16_t discharge_basic_soc;                        // 荷电状态
    uint16_t discharge_basic_remaining_mileage;          // 里程
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_DISCHARGE_BASIC_EVCC  5

//充放电机动态输出能力报文(预充及能量传输)
#define OPENCHAOJI_GBT27930_B_PID_TAG_DISCHARGE_ABILITY_SECC         OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_DISCHARGING_ABILITY_SECC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_DISCHARGE_ABILITY_SECC     5000
#define OPENCHAOJI_GBT27930_B_PID_TIMELOOP_DISCHARGE_ABILITY_SECC    0

struct OpenChaoJi_gbt27930_b_msg_discharging_output_capability_secc {
    uint8_t  pid;                                                // 参数组标识
    uint16_t discharge_dynamic_output_power_capability_curr;     // 充放电机当前放电的最大电流
    uint8_t  discharge_dynamic_output_power_capability_reason;   // 输出能力变化的原因
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_DISCHARGE_ABILITY_SECC  4

//充放电机放电状态报文
#define OPENCHAOJI_GBT27930_B_PID_TAG_DISCHARGE_STATUS_SECC         OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_DISCHARGING_STATUS_SECC, 0)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_DISCHARGE_STATUS_SECC     0
#define OPENCHAOJI_GBT27930_B_PID_TIMELOOP_DISCHARGE_STATUS_SECC    1000
struct OpenChaoJi_gbt27930_b_msg_discharging_status_secc {
    uint8_t  pid;                                       // 参数组标识
    uint16_t discharge_status_measure_volt;             // 充放电机放电电压测量值
    uint16_t discharge_status_measure_curr;             // 充放电机放电电流测量值
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_DISCHARGE_STATUS_SECC  5

#endif  // OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_DISCHARGING

/**************************服务统计停止中*************************/


//STATE超时(服务统计阶段确认超时)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_STATE_TC_SECC       2000

#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_NORMAL_TC_SECC      12000
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_NORMAL_T1_SECC      5000    //5S 5A
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_NORMAL_T2_SECC      3000    //3S C1C2断开
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_NORMAL_T3_SECC      3000    //60v
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_NORMAL_T4_SECC      1000

#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_FAULT_TC_SECC       9000
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_FAULT_T1_SECC       2000      //2S 5A
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_FAULT_T2_SECC       3000      //3S C1C2断开
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_FAULT_T3_SECC       3000      //60v
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_FAULT_T4_SECC       1000

#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_EMRGE_TC_SECC       2120
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_EMRGE_T1_SECC       20
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_EMRGE_T2_SECC       100
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_EMRGE_T3_SECC       1000
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_EMRGE_T4_SECC       1000
//Tv超时(服务统计阶段确认超时)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_STATE_TV_EVCC       2000

#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_NORMAL_TV_EVCC      12000   //停机阶段超时
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_NORMAL_T1_EVCC      5000    //C5C6
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_NORMAL_T2_EVCC      2000    //s2
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_NORMAL_T3_EVCC      1000    //s2
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_NORMAL_T4_EVCC      3000    //60v电子锁
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_NORMAL_T5_EVCC      1000    //s2p

#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_FAULT_TV_EVCC       10000
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_FAULT_T1_EVCC       2000      //2S 5A
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_FAULT_T2_EVCC       3000      //3S C1C2断开
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_FAULT_T3_EVCC       3000      //60v
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_FAULT_T4_EVCC       1000
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_FAULT_T5_EVCC       1000

#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_EMRGE_TV_EVCC       2200
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_EMRGE_T1_EVCC       100       //等降5A 断C5C6
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_EMRGE_T2_EVCC       100       //C5C6断开时间
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_EMRGE_T3_EVCC       1000
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_STOPPING_EMRGE_T4_EVCC       1000






/****************************服务统计****************************/


#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_STATISTICS == CONFIG_YES)

#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_STATISTICS == CONFIG_YES)

/**
 * 服务统计-充电机统计信息SECC(FDC=1) 0x81
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_STATISTICS_SECC        OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_STATISTICS_SECC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_SECC    1000
// Tc超时
#define OPENCHAOJI_GBT27930_B_PID_TC_TIMEOUT_STATISTICS_SECC 5000
// 表J.3 充电机统计信息报文参数组
struct OpenChaoJi_gbt27930_b_msg_statistics_secc {
    uint8_t                             pid;                       // 参数组标识
    OpenChaoJi_gbt27930_b_CapcityType   charge_total_energy;       // 充电机本次充电总的充电能量
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_STATISTICS_SECC   3

/**
 * 服务统计-车辆统计信息EVCC(FDC=1) 0x82
 */
#define OPENCHAOJI_GBT27930_B_PID_TAG_STATISTICS_EVCC        OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_STATISTICS_EVCC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STATISTICS_EVCC    1000
// Tv超时
#define OPENCHAOJI_GBT27930_B_PID_TV_TIMEOUT_STATISTICS_EVCC 5000
// 表J.4 车辆统计信息报文参数组
struct OpenChaoJi_gbt27930_b_msg_statistics_evcc {
    uint8_t                             pid;                       // 参数组标识
    OpenChaoJi_gbt27930_b_SOCType       charge_stop_SOC;           // 车辆中止时的荷电状态
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_STATISTICS_EVCC   3
    #endif

#endif

/****************************公共报文****************************/

#define OPENCHAOJI_GBT27930_B_PID_TAG_PHASE_INFO_SECC        OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_PUBLIC_PHASE_INFO_SECC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_PHASE_INFO_SECC    1000
// 表52 充电机阶段信息报文
struct OpenChaoJi_gbt27930_b_msg_phase_info_secc {
    uint8_t pid;                            // enum SystemB_PIDType
    uint8_t fc_type;
    uint8_t fdc_type;
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_PHASE_INFO_SECC   3


#define OPENCHAOJI_GBT27930_B_PID_TAG_PHASE_ACK_EVCC        OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_PUBLIC_PHASE_ACK_EVCC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_PHASE_ACK_EVCC    1000
// 表53 车辆阶段确认报文
struct OpenChaoJi_gbt27930_b_msg_phase_ack_evcc {
    uint8_t pid;                            // enum SystemB_PIDType
    uint8_t phase_ack;
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_PHASE_ACK_EVCC   2


#define OPENCHAOJI_GBT27930_B_PID_TAG_STOP_INFO_SECC        OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_PUBLIC_STOP_INFO_SECC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STOP_INFO_SECC    1000
/**
 * 充电机中止报文
*/
struct OpenChaoJi_gbt27930_b_msg_stop_info_secc {
    uint8_t pid;                            //  参数组标识
    uint8_t end_code;                       //  充电机中止类型
    uint8_t end_Reason;                     //  充电机中止原因
    uint8_t fault_code[4];                  //  故障代码
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_STOP_INFO_SECC   7


#define OPENCHAOJI_GBT27930_B_PID_TAG_STOP_INFO_EVCC        OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_PUBLIC_STOP_INFO_EVCC, 1)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_STOP_INFO_EVCC    1000
/**
 * 车辆中止报文
*/
struct OpenChaoJi_gbt27930_b_msg_stop_info_evcc {
    uint8_t pid;                            //  参数组标识
    uint8_t end_code;                       //  车辆中止类型
    uint8_t end_Reason;                     //  车辆中止原因
    uint8_t fault_code[4];                  //  故障代码
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_STOP_INFO_EVCC   7


#define OPENCHAOJI_GBT27930_B_PID_TAG_RELAY_STATUS_SECC        OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_PUBLIC_RELAY_STATUS_SECC, 0)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_RELAY_STATUS_SECC    0
#define OPENCHAOJI_GBT27930_B_PID_TIMELOOP_RELAY_STATUS_SECC   250
/**
 * 充电机直流回路接触器状态报文
*/
struct OpenChaoJi_gbt27930_b_msg_relay_status_secc {
    uint8_t pid;                           //  参数组标识
    uint8_t contact_c1;                    //  接触器状态C1
    uint8_t contact_c2;                    //  接触器状态C1
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_RELAY_STATUS_SECC   3


#define OPENCHAOJI_GBT27930_B_PID_TAG_RELAY_STATUS_EVCC        OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_PUBLIC_RELAY_STATUS_EVCC, 0)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_RELAY_STATUS_EVCC    0
#define OPENCHAOJI_GBT27930_B_PID_TIMELOOP_RELAY_STATUS_EVCC   250
/**
 * 车辆断开装置状态报文
*/
struct OpenChaoJi_gbt27930_b_msg_relay_status_evcc {
    uint8_t pid;                            //  参数组标识
    uint8_t contact_c5;                     //  接触器状态C1
    uint8_t contact_c6;                     //  接触器状态C1
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_RELAY_STATUS_EVCC   3


#define OPENCHAOJI_GBT27930_B_PID_TAG_LATCHING_STATUS_EVCC        OPENCHAOJI_GBT27930_B_PID_TAG(OPENCHAOJI_GBT27930_B_PGI_PUBLIC_LATCHING_STATUS_EVCC, 0)
#define OPENCHAOJI_GBT27930_B_PID_TIMEOUT_LATCHING_STATUS_EVCC    0
#define OPENCHAOJI_GBT27930_B_PID_TIMELOOP_LATCHING_STATUS_EVCC   250
/**
 * 车辆电子锁状态报文
*/
struct OpenChaoJi_gbt27930_b_msg_latching_status_evcc {
    uint8_t pid;                            //  参数组标识
    uint8_t latching_status;                //  车辆电子锁锁止状态信息
};
#define OPENCHAOJI_GBT27930_B_MSG_LEN_LATCHING_STATUS_EVCC   2



/**
 * 统一消息处理, 用于decode/encode
 */
struct OpenChaoJi_gbt27930_b_msg {

    uint8_t pid;    // pid决定消息类型, 可以不再使用额外的枚举

    union {
        struct OpenChaoJi_gbt27930_b_msg_func_support_secc func_support_secc;
        struct OpenChaoJi_gbt27930_b_msg_func_support_evcc func_support_evcc;
        struct OpenChaoJi_gbt27930_b_msg_param_config_secc param_config_secc;
        struct OpenChaoJi_gbt27930_b_msg_param_config_evcc param_config_evcc;
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_AUTH == CONFIG_YES)
    #if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_AUTH_RFID == CONFIG_YES)
        struct OpenChaoJi_gbt27930_b_msg_auth_rfid_param_secc auth_rfid_param_secc;
        struct OpenChaoJi_gbt27930_b_msg_auth_rfid_result_secc auth_rfid_result_secc;
        struct OpenChaoJi_gbt27930_b_msg_auth_rfid_wait_evcc auth_rfid_wait_evcc;
    #endif
    #if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_AUTH_EVIN == CONFIG_YES)
        struct OpenChaoJi_gbt27930_b_msg_auth_evin_req_secc auth_evin_req_secc;
        struct OpenChaoJi_gbt27930_b_msg_auth_evin_param_evcc auth_evin_param_evcc;
        struct OpenChaoJi_gbt27930_b_msg_auth_evin_result_secc auth_evin_result_secc;
    #endif
#endif
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_RESERVE == CONFIG_YES)
    #if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_RESERVE_EVCC == CONFIG_YES)
        struct OpenChaoJi_gbt27930_b_msg_reserve_info_secc reserve_info_secc;
        struct OpenChaoJi_gbt27930_b_msg_reserve_confirm_secc reserve_confirm_secc;
        struct OpenChaoJi_gbt27930_b_msg_reserve_info_evcc reserve_info_evcc;
        struct OpenChaoJi_gbt27930_b_msg_reserve_nego_evcc reserve_nego_evcc;
    #endif
#endif
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_SELFCHECK == CONFIG_YES)
    #if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_SELFCHECK_GENERAL == CONFIG_YES)
        struct OpenChaoJi_gbt27930_b_msg_selfcheck_status_secc selfcheck_status_secc;
        struct OpenChaoJi_gbt27930_b_msg_selfcheck_result_secc selfcheck_result_secc;
    #endif
#endif
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_SUPPLY == CONFIG_YES)
    #if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_SUPPLY_BASIC == CONFIG_YES)
        struct OpenChaoJi_gbt27930_b_msg_supply_status_secc supply_status_secc;
        struct OpenChaoJi_gbt27930_b_msg_supply_status_evcc supply_status_evcc;
        struct OpenChaoJi_gbt27930_b_msg_supply_requirement_evcc supply_requirement_evcc;
        struct OpenChaoJi_gbt27930_b_msg_supply_ability_secc supply_ability_secc;
        struct OpenChaoJi_gbt27930_b_msg_supply_finish_evcc supply_finish_evcc;
    #endif
#endif
    #if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_CHARGING == CONFIG_YES)
        struct OpenChaoJi_gbt27930_b_msg_charging_ready_secc charging_ready_secc;
        struct OpenChaoJi_gbt27930_b_msg_charging_ready_evcc charging_ready_evcc;
        struct OpenChaoJi_gbt27930_b_msg_charging_requirement_evcc charging_requirement_evcc;
        struct OpenChaoJi_gbt27930_b_msg_charging_info_basic_evcc charging_info_basic_evcc;
        struct OpenChaoJi_gbt27930_b_msg_charging_info_battery_evcc charging_info_battery_evcc;
        struct OpenChaoJi_gbt27930_b_msg_charging_ability_secc charging_ability_secc;
        struct OpenChaoJi_gbt27930_b_msg_charging_pause_secc charging_pause_secc;
        struct OpenChaoJi_gbt27930_b_msg_charging_pause_evcc charging_pause_evcc;
    #endif
    #if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_DISCHARGING == CONFIG_YES)
        struct OpenChaoJi_gbt27930_b_msg_discharging_readiness_info_secc discharging_readiness_info_secc;
        struct OpenChaoJi_gbt27930_b_msg_discharging_readiness_info_evcc discharging_readiness_info_evcc;
        struct OpenChaoJi_gbt27930_b_msg_discharging_status_info_evcc discharging_status_info_evcc;
        struct OpenChaoJi_gbt27930_b_msg_discharging_basic_info_evcc discharging_basic_info_evcc;
        struct OpenChaoJi_gbt27930_b_msg_discharging_output_capability_secc discharging_output_capability_secc;
        struct OpenChaoJi_gbt27930_b_msg_discharging_status_secc discharging_status_secc;
    #endif
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_STATISTICS == CONFIG_YES)
    #if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_STATISTICS == CONFIG_YES)
        struct OpenChaoJi_gbt27930_b_msg_statistics_secc statistics_secc;
        struct OpenChaoJi_gbt27930_b_msg_statistics_evcc statistics_evcc;
    #endif
#endif
        struct OpenChaoJi_gbt27930_b_msg_phase_info_secc phase_info_secc;
        struct OpenChaoJi_gbt27930_b_msg_phase_ack_evcc phase_ack_evcc;
        struct OpenChaoJi_gbt27930_b_msg_relay_status_secc relay_status_secc;
        struct OpenChaoJi_gbt27930_b_msg_relay_status_evcc relay_status_evcc;
        struct OpenChaoJi_gbt27930_b_msg_latching_status_evcc latching_status_evcc;
        struct OpenChaoJi_gbt27930_b_msg_stop_info_secc stop_info_secc;
        struct OpenChaoJi_gbt27930_b_msg_stop_info_evcc stop_info_evcc;
    } msg;
};

/**
 * @function OpenChaoJi_gbt27930_b_msg_len
 * @brief 获取消息长度
 * @param pgi 消息类型
 * @return int 消息长度
 */
extern int OpenChaoJi_gbt27930_b_msg_len(uint8_t pgi);

/**
 * @function OpenChaoJi_gbt27930_b_msg_decode
 * @brief 解码
 * @param msg 消息结构体(输出)
 * @param data 数据(输入)
 * @param len 数据长度
 * @return true 成功
 */
extern bool OpenChaoJi_gbt27930_b_msg_decode(struct OpenChaoJi_gbt27930_b_msg *msg, unsigned char *data, int len);

/**
 * @function OpenChaoJi_gbt27930_b_msg_encode
 * @brief 编码
 * @param msg 消息结构体(输入)
 * @param data 数据(输出)
 * @param max_len 数据最大长度
 * @return int 实际编码数据长度, 小于0表示失败
 */
extern int OpenChaoJi_gbt27930_b_msg_encode(struct OpenChaoJi_gbt27930_b_msg *msg, unsigned char *data, int max_len);

/**
 * @function OpenChaoJi_gbt27930_b_msg_encode_data
 * @brief 编码, 并动态分配内存
 * @param msg 消息结构体(输入)
 * @param data_len 数据长度(输出)
 * @return unsigned char * 编码数据 NULL表示失败
 */
extern unsigned char * OpenChaoJi_gbt27930_b_msg_encode_data(struct OpenChaoJi_gbt27930_b_msg *msg, int * data_len);

/**
 * @function OpenChaoJi_gbt27930_b_msg_log
 * @brief 日志
 * @param msg 消息结构体
 * @return void
 */
extern void OpenChaoJi_gbt27930_b_msg_log(const struct OpenChaoJi_gbt27930_b_msg *msg);

/**
 * @function OpenChaoJi_gbt27930_b_msg_cmpcpy系列
 */
#define DECLARE_GBT27930_B_MSG_CMPCPY(TYPE_NAME) \
    extern bool OpenChaoJi_gbt27930_b_msg_cmpcpy_##TYPE_NAME(int tag, struct OpenChaoJi_gbt27930_b_msg_##TYPE_NAME *dst, const struct OpenChaoJi_gbt27930_b_msg_##TYPE_NAME *src);

DECLARE_GBT27930_B_MSG_CMPCPY(func_support_secc)
DECLARE_GBT27930_B_MSG_CMPCPY(func_support_evcc)
DECLARE_GBT27930_B_MSG_CMPCPY(param_config_secc)
DECLARE_GBT27930_B_MSG_CMPCPY(param_config_evcc)
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_AUTH == CONFIG_YES)
    #if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_AUTH_RFID == CONFIG_YES)
DECLARE_GBT27930_B_MSG_CMPCPY(auth_rfid_param_secc)
DECLARE_GBT27930_B_MSG_CMPCPY(auth_rfid_result_secc)
DECLARE_GBT27930_B_MSG_CMPCPY(auth_rfid_wait_evcc)
    #endif
    #if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_AUTH_EVIN == CONFIG_YES)
DECLARE_GBT27930_B_MSG_CMPCPY(auth_evin_req_secc)
DECLARE_GBT27930_B_MSG_CMPCPY(auth_evin_param_evcc)
DECLARE_GBT27930_B_MSG_CMPCPY(auth_evin_result_secc)
    #endif
#endif
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_RESERVE == CONFIG_YES)
    #if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_RESERVE_EVCC == CONFIG_YES)
DECLARE_GBT27930_B_MSG_CMPCPY(reserve_info_secc)
DECLARE_GBT27930_B_MSG_CMPCPY(reserve_confirm_secc)
DECLARE_GBT27930_B_MSG_CMPCPY(reserve_info_evcc)
DECLARE_GBT27930_B_MSG_CMPCPY(reserve_nego_evcc)
    #endif
#endif

#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_SELFCHECK == CONFIG_YES)
    #if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_SELFCHECK_GENERAL == CONFIG_YES)
DECLARE_GBT27930_B_MSG_CMPCPY(selfcheck_status_secc)
DECLARE_GBT27930_B_MSG_CMPCPY(selfcheck_result_secc)
    #endif
#endif
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_SUPPLY == CONFIG_YES)
    #if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_SUPPLY_BASIC == CONFIG_YES)
DECLARE_GBT27930_B_MSG_CMPCPY(supply_status_secc)
DECLARE_GBT27930_B_MSG_CMPCPY(supply_status_evcc)
DECLARE_GBT27930_B_MSG_CMPCPY(supply_requirement_evcc)
DECLARE_GBT27930_B_MSG_CMPCPY(supply_ability_secc)
DECLARE_GBT27930_B_MSG_CMPCPY(supply_finish_evcc)
    #endif
#endif
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_CHARGING == CONFIG_YES)
DECLARE_GBT27930_B_MSG_CMPCPY(charging_ready_secc)
DECLARE_GBT27930_B_MSG_CMPCPY(charging_ready_evcc)
DECLARE_GBT27930_B_MSG_CMPCPY(charging_requirement_evcc)
DECLARE_GBT27930_B_MSG_CMPCPY(charging_info_basic_evcc)
DECLARE_GBT27930_B_MSG_CMPCPY(charging_info_battery_evcc)
DECLARE_GBT27930_B_MSG_CMPCPY(charging_ability_secc)
DECLARE_GBT27930_B_MSG_CMPCPY(charging_pause_secc)
DECLARE_GBT27930_B_MSG_CMPCPY(charging_pause_evcc)
#endif
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_DISCHARGING == CONFIG_YES)
DECLARE_GBT27930_B_MSG_CMPCPY(discharging_readiness_info_secc)
DECLARE_GBT27930_B_MSG_CMPCPY(discharging_readiness_info_evcc)
DECLARE_GBT27930_B_MSG_CMPCPY(discharging_status_info_evcc)
DECLARE_GBT27930_B_MSG_CMPCPY(discharging_basic_info_evcc)
DECLARE_GBT27930_B_MSG_CMPCPY(discharging_output_capability_secc)
DECLARE_GBT27930_B_MSG_CMPCPY(discharging_status_secc)
#endif
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_STATISTICS == CONFIG_YES)
    #if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FDC_STATISTICS == CONFIG_YES)
DECLARE_GBT27930_B_MSG_CMPCPY(statistics_secc)
DECLARE_GBT27930_B_MSG_CMPCPY(statistics_evcc)
    #endif
#endif
DECLARE_GBT27930_B_MSG_CMPCPY(phase_info_secc)
DECLARE_GBT27930_B_MSG_CMPCPY(phase_ack_evcc)
DECLARE_GBT27930_B_MSG_CMPCPY(relay_status_secc)
DECLARE_GBT27930_B_MSG_CMPCPY(relay_status_evcc)
DECLARE_GBT27930_B_MSG_CMPCPY(latching_status_evcc)
DECLARE_GBT27930_B_MSG_CMPCPY(stop_info_secc)
DECLARE_GBT27930_B_MSG_CMPCPY(stop_info_evcc)

#endif // OPENCHAOJI_CONFIG_ENABLE_GBT27930_B

#endif
